package com.api.department.getmembers;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.ContextConfiguration;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.api.test.AbstractApiTest;
import com.zyncro.api.IDepartmentApiService;
import com.zyncro.api.exceptions.ZyncroApiException;
import com.zyncro.api.model.MemberApi;
import com.zyncro.api.model.PagedItemsResultApi;

@ContextConfiguration(locations = "classpath:/department/department-members.xml")
public class GetMembersHidedNotMember extends AbstractApiTest {

	@Value("#{department_toGetMembersHided[notMember].appId}")
	private String userUrn;

	@Value("#{department_toGetMembersHided[notMember].password}")
	private String userPassword;

	@Value("#{department_toGetMembersHided.urn}")
	private String iddepartment;

	@BeforeClass
	protected void loginUser() throws Exception {

		getApi().login(userUrn, userPassword);
	}

	@Test
	public void test() throws ZyncroApiException {

		int pageNumber = 0;
		int itemsPerPage = 0;

		PagedItemsResultApi<MemberApi> result = getApi().getService(IDepartmentApiService.class).getMembers(iddepartment, pageNumber,
				itemsPerPage);

		Assert.assertEquals(result.getTotalItems(), 0);
	}
}
